﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.JCI.Common.Utility;
using System.Data;
using System.Data.Common;
using Microsoft.JCI.Common.Entity;


namespace Microsoft.JCI.Dal
{
    public class Util : DalBase
    {
        public SysAutoCodeRuleEntity GetEntity(string CodeRuleName)
        {
            SysAutoCodeRuleEntity entity = null;
            DbCommand dbcommand = CurrentDatabase.GetStoredProcCommand("proc_GenId");
            CurrentDatabase.AddInParameter(dbcommand, "@RuleId", DbType.String, CodeRuleName);
            using (IDataReader reader = CurrentDatabase.ExecuteReader(dbcommand))
            {
                entity = this.GetFromReader<SysAutoCodeRuleEntity>(reader);
            }
            return entity;
        }
    }
}
